<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Math随机数</title>
</head>

<body>
  <script>
    //返回0-1之间的书技术 [0,1)
    //floor表示转化为整数向下取整

    //生成0-10  0-10之间+1取到10点多包括10
    console.log(Math.floor(Math.random() * (10 + 1)))

    //如何生成5-15的随机整数？
    console.log(Math.floor(Math. random() * (10 + 1) + 5))


    //如何生成N-M之间的随机整数?
    // console.log(Math.floor(Math.random() * (M - N + 1) + N))

  </script>
</body>

</html>